package com.longyi.admin.controller;

import com.longyi.admin.common.Result;
import com.longyi.admin.entity.ChartPie;
import com.longyi.admin.service.MenuService;
import com.longyi.admin.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/echart")
public class EchartsController {
    @Autowired
    private UserService userService;
    @Autowired
    private MenuService menuService;
    //用户角色比例
    @GetMapping("/pie1")
    public Result pie1() {
        List<ChartPie> list = userService.getUserType();
        return Result.suc(list);
    }
    //菜单类型比例
    @GetMapping("/pie2")
    public Result pie2() {
        List<ChartPie> list = menuService.getMenuType();
        return Result.suc(list);
    }
}
